import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-07-16
 * Time: 17:26
 */
public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while( scanner.hasNext()) {
            Set< String> set = new HashSet<>();
            int k = 0;
            String s = scanner.next();
            String [] word = new String[50];
            String s2 = "";
            for( int i=0 ;i< s.length();i++) {
                char ch = s.charAt(i);
                if( ch != ' ' ) {
                    s2 = s2 + ch + "";
                } else if( ch == ' ' || ch =='\n'){
                    word[k++] = s2;
                    s2 = "";
                }
            }
            for( int i=0 ;i<k;i++) {
                set.add( word[i]);
            }
            System.out.println(set.size());
        }
    }
}
